gtk/scrolledwindow: Handle full scroll sequences only
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 11 Dec 2020 23:40:12 +0000 (00:40 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 12 Dec 2020 00:42:42 +0000 (01:42 +0100)
commite9fe270e94d6dbae4655f8a31910f9fb7288d457
treeba45cd6f4bfea32814fd5b4f4d620897f397a137
parent8402665c5528e2d475143a5ea4c09d1d9c2d40d8
gtk/scrolledwindow: Handle full scroll sequences only

In order to do this, leverage smooth scroll handling into the capture
phase scroll controller, controlled by ::scroll-begin in the propagation
phase controller.

There's 2 cases here:
- A child widget handles scroll. The scrolled window does not get
  ::scroll-begin, the child widget handles the full scroll sequence.
- No child handles scroll, the scrolled window gets ::scroll-begin,
  and transfers control of scrolling to the capture phase controller.
  As scrolling is performed, the pointer may fall into scrollable children,
  but the scrolled window will be capturing the scroll events, so these
  won't be seen by the child widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/593
gtk/gtkscrolledwindow.c